<?php
include_once('common/header.php');
$intTotal 			= 0;
$intPage			= $objRequest->getParam('page', 1);
$intCategoryId 		= $objRequest->getParam('cat', 0);
$intSubCategoryId 	= $objRequest->getParam('sub', 0);
$intFilter 			= $objRequest->getParam('fi', 0);
$intSort 			= $objRequest->getParam('ord', 0);
$intLimit 			= NEWS_LIMIT;	
$intOffset			= ($intPage-1)*$intLimit;
$objCommon			= new Vfriend_Common();
$objNews 			= new News();
$arrList 			= $objNews->getAll($intSubCategoryId, '', 0, $intFilter, $intSort, $intOffset, $intLimit, $intTotal);
if($intTotal >= MAX_DISPLAY) {
	$intTotal	= MAX_DISPLAY;
}
$this->view->arrList 		= $arrList;
if(!isset($intAjax)) {
	$this->view->arrCate 	= $objCommon->getCategoryById($intSubCategoryId);
	$this->view->intFilter 	= $intFilter;
	$this->view->arrFilter 	= $arrOrderDate;
	$this->view->intSort 	= $intSort;
	$this->view->arrSort 	= $arrOrderType;
}
$this->view->intTotalPage	= ceil($intTotal / $intLimit);
$this->view->intPage 		= $intPage;	
?>
